/**
 * Created by weiwei on 2017/3/3.
 */
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image
} from 'react-native';
import Icon from 'react-native-vector-icons/EvilIcons';
var {width,height} = require('Dimensions').get('window');
var LazyActivityCell = React.createClass({
    getDefaultProps(){
      return {
        image:'',
        name:'',
        price:'',
        date:'',
        address:'',
        free:'',
      }
    },
    render() {
        return (
            <View style={styles.container}>
                <Image source={{uri:this.props.image}} style={styles.activityImage}/>
                <View style={styles.activitySub}>
                    <Text style={{color:'#1b3847'}}>{this.props.name}</Text>
                    <Text style={{color:'#08c8c1',textDecorationLine:'underline'}}>¥{this.props.price}</Text>
                </View>
                <View style={[styles.flexRowBewteen,styles.activityAddress]}>
                    <View style={[styles.flexRow,{flex:2}]}>
                        <Icon name={'location'} size={25} color="#b4c5d3"/>
                        <Text style={styles.subTextStyle}>{this.props.address}</Text>
                    </View>
                    <View style={[styles.flexRow,{flex:2}]}>
                        <Icon name={'clock'} size={25} color="#b4c5d3"/>
                        <Text style={styles.subTextStyle}>{this.props.date}</Text>
                    </View>
                </View>
            </View>
        );
    }
});
const styles = StyleSheet.create({
    container: {
        flex: 1,
        marginBottom:15
    },
    activityImage:{
        width:width - 20,
        height:200,
        borderRadius:5,
        resizeMode:'cover'
    },
    activitySub:{
        flexDirection:'row',
        paddingTop:8,
        paddingLeft:5,
        paddingRight:5,
        justifyContent:'space-between'
    },
    activityAddress:{
        flex:1,
        marginTop:5
    },
    subTextStyle:{
        fontSize:13,
        color:'#b4c5d3'
    },
    flexRow:{
        flexDirection:'row',
        alignItems:'center'
    },
    flexRowBewteen:{
        flexDirection:'row',
        alignItems:'center',
    }
});
module.exports = LazyActivityCell;